<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo03"
        aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="<c:url value="/Home"/>">
    ${initParam.AppName}的博客
</a>

<div class="collapse navbar-collapse" id="navbarTogglerDemo03">
    <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
        <li class="nav-item active">
            <a class="nav-link" href="<c:url value="/Home"/>">主页</a>
        </li>
        <li class="nav-item">
            <c:if test="${empty sessionScope.uemail}">
                <a class="nav-link" href="<c:url value="/login"/>">登录</a>
            </c:if>
            <c:if test="${not empty sessionScope.uemail}">
                <a class="nav-link" href="<c:url value="/logout"/>">登出</a>
            </c:if>
        </li>
        <li class="nav-item">
            <c:if test="${empty sessionScope.uemail}">
                <a class="nav-link disabled" href="<c:url value="/admin"/>">管理</a>
            </c:if>
            <c:if test="${not empty sessionScope.uemail}">
                <a class="nav-link" href="<c:url value="/admin"/>">管理</a>
            </c:if>
        </li>
        <li>
            <c:if test="${not empty sessionScope.uemail}">
                <a class="nav-link" href="<c:url value="/insert"/>">发布文章</a>
            </c:if>
        </li>
    </ul>
    <form class="form-inline my-2 my-lg-0" action="<c:url value="/search"/>" method="GET">
        <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" name="q">
        <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
    </form>
</div>